home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / MorphOS / Epic4_mos / share / epic / help / 5_programming / do < prev    next >
Encoding:
Text File  |  2002-10-28  |  1.1 KB  |  35 lines

  1. Synopsis:
  2.    do <commands>
  3.    do { <commands> } [while (<condition>)]
  4.  
  5. Description:
  6.    In its base form, DO behaves much like EVAL.  It evaluates its input
  7.    once, then executes it.  It is superior in some respects, however.  For
  8.    instance, it can cope with complex commands (multiple commands within
  9.    curly braces).
  10.  
  11.    Furthermore, DO has the ability to mimic the WHILE command.  While the
  12.    operation is not identical, it is similar.  It only differs in that the
  13.    condition is evaluated after each loop iteration, so the loop is
  14.    guaranteed to run for at least one iteration.
  15.  
  16. See Also:
  17.    To force expansion of some variable $foo:
  18.       /do echo the variable $$foo expands to $foo
  19.  
  20.    To run the same command in indefinite number of times, but at least once:
  21.       assign blah 2
  22.       do {
  23.          echo $blah is lower than 3
  24.       }
  25.       while ( blah = rand(5) < 3 )
  26.  
  27. See Also:
  28.    eval(5); while(5)
  29.  
  30. Other Notes:
  31.    This command is mostly supported for compatibility with previous ircII
  32.    clients.  Internally, it uses more resources than EVAL, so it isn't of
  33.    much practical use, save for its looping ability.
  34.  
  35.